package com.practice.tetris.ui;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Zhouyue on 2015/6/6.
 */
public class FrameGame extends JFrame {
    public FrameGame() {
        //设置标题
        this.setTitle("Java俄罗斯方块");
        //设置默认关闭
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //设置窗口大小
        this.setSize(1168, 680);
        //不允许改变窗口大小
        this.setResizable(false);
        //窗口居中
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension screenSize = toolkit.getScreenSize();
        int x = (screenSize.width - this.getWidth()) / 2;
        int y = (screenSize.height - this.getHeight()) / 2 - 16;
        this.setLocation(x, y);
        //设置Panel
        this.setContentPane(new PanelGame());
    }
}
